Exception in xen/util/vscsi_util.py while starting xend
author"Dube, Lutz" <lutz.dube@ts.fujitsu.com>
Wed, 11 Aug 2010 12:18:05 +0000 (13:18 +0100)
committer"Dube, Lutz" <lutz.dube@ts.fujitsu.com>
Wed, 11 Aug 2010 12:18:05 +0000 (13:18 +0100)
 
We have pscsi device with long scsi ids like 15:0:11:101.
In this case lsscsi prints no "blank" between id and type,
so the following split of the string returns wrong output.
The field physical_HCTL is set to 15:0:11:101]dis.
The patch replaces char "]" by "] ", so split() will return the right
physical_HTCL.

Signed-off-by: Lutz Dube Lutz.Dube@ts.fujitsu.com
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/python/xen/util/vscsi_util.py

index 8d5351f4fd9d7f971086cdce7995ce8c0884c88b..9abf66b84bce233e96db3ec9a21e6711e3a03931 100644 (file)
@@ -97,7 +97,7 @@ def _vscsi_get_scsidevices_by_lsscsi(option = ""):
     devices = []
 
     for scsiinfo in os.popen('{ lsscsi -g %s; } 2>/dev/null' % option).readlines():
-        s = scsiinfo.split()
+        s = scsiinfo.replace(']', '] ').split()
         hctl = s[0][1:-1]
         try:
             devname = s[-2].split('/dev/')[1]